<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<!--

    Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="StarOffice 8  (Win32)">
	<META NAME="AUTHOR" CONTENT="chiaming">
	<META NAME="CREATED" CONTENT="20080902;12395900">
	<META NAME="CHANGED" CONTENT="20081001;13392979">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P><A NAME="ez.:"></A><A NAME="ez.:0"></A><A NAME="ez.:1"></A><A NAME="ez.:2"></A><A NAME="ez.:3"></A><A NAME="ez.:4"></A><A NAME="y.gx"></A><A NAME="y.gx0"></A><A NAME="l9id0"></A><A NAME="ez.:5"></A><A NAME="x:ok"></A><A NAME="o323"></A><A NAME="o3235"></A><A NAME="fvuq"></A><A NAME="qnkh"></A><A NAME="bmcq1"></A><A NAME="bmcq3"></A><A NAME="ny2w"></A><A NAME="o3232"></A><A NAME="o3234"></A><A NAME="b0qe2"></A><A NAME="qnkh0"></A><A NAME="qnkh1"></A><A NAME="i.0c"></A><A NAME="i.0c0"></A><A NAME="za97"></A><A NAME="za970"></A><A NAME="edvc"></A><A NAME="edvc0"></A><A NAME="b-vi"></A><A NAME="duy10"></A><A NAME="duy11"></A><A NAME="duy12"></A><A NAME="duy13"></A><A NAME="duy14"></A><A NAME="duy15"></A><A NAME="duy16"></A><A NAME="duy17"></A><A NAME="duy18"></A><A NAME="duy19"></A><A NAME="duy110"></A><A NAME="duy111"></A><A NAME="t9ec"></A><A NAME="axwb"></A><A NAME="hdav"></A><A NAME="p.im"></A><A NAME="p.im0"></A><A NAME="qqbq"></A><A NAME="wrfs"></A><A NAME="wrfs0"></A><A NAME="wrfs1"></A><A NAME="wrfs2"></A><A NAME="wrfs3"></A><A NAME="gbfi"></A><A NAME="d6:5"></A><A NAME="b-vi0"></A><A NAME="d6:50"></A><A NAME="rg3:"></A><A NAME="p-xu"></A><A NAME="pm1b0"></A><A NAME="pm1b1"></A><A NAME="pm1b2"></A><A NAME="pm1b3"></A><A NAME="pm1b4"></A><A NAME="pm1b5"></A><A NAME="pm1b7"></A><A NAME="rz_1"></A><A NAME="rz_10"></A><A NAME="x57o"></A><A NAME="rz_11"></A><A NAME="rz_12"></A><A NAME="rz_13"></A><A NAME="rz_14"></A><A NAME="pm1b8"></A><A NAME="gbfi1"></A>
<FONT SIZE=4><B>receive_reply</B></FONT></P>
<P><B>receive_reply</B> is an http response message to the <A HREF="./receive.html"><B>receive</B></A>
service request.</P>
<P>For the Simple Messaging API, <B>receive_reply</B> contains the
retrieved text message, with no additional packaging, in the http
response message body. The response message is encoded with UTF-8
encoding (Content-Type: text/plain;charset=UTF-8).</P>
<P>If the <B>receive</B> service request times out because no message
is available, the r<B>eceive_reply</B> response message body is
empty. In this case, the http extension-header's ums.status field is
set to the value &quot;404&quot;.</P>
<P>For the Simple Messaging API, <B>receive_reply</B> sets the
following extension-header fields in the response message:</P>
<P>ums.service: receive_reply<BR>ums.destination: <BR>ums.domain:
<BR>ums.mom: openmq<BR>ums.status: 200 (404 if <B>receive</B> request
times out because no message is available)<BR><BR>For the XML
Messaging API, the retrieved message (JMS BytesMessage) is
transformed into a SOAP message and <B>receive_reply</B> places it in
the http response message body. The response message is encoded with
UTF-8 encoding (Content-Type: text/xml;charset=UTF-8).</P>
<P>If the <B>receive</B> request times out because no message is
available, the value of the ums:status attribute in the Service
element of the SOAP message header is set to &quot;404&quot;. 
</P>
<P>For the XML Messaging API, <B>receive_reply</B> sets the following
attributes of the Service element of the SOAP message header :</P>
<P>&lt;uns:Service<BR>ums:service=&quot;receive_reply&quot;
<BR>ums:destination=<BR>ums:domain=<BR>ums:mom=&quot;openmq&quot;
<BR>ums:status=&quot;200&quot;/&gt;</P>
<P>For both the Simple Messaging API and the XML Messaging API, a 200
status code indicates the <B>receive</B> service request was
successful. All other status codes indicate the <B>receive</B>
service request might not be successful.</P>
<P>1. Simple Messaging API Example: 
</P>
<P>The following is a <B>receive_reply</B> response message that
contains the text message &quot;SimpleMsg_0&quot; in the response
message body.</P>
<P>HTTP/1.1 200 OK <BR>Server: Apache-Coyote/1.1 <BR>ums.service:
receive_reply <BR>ums.destination: simpleMessagingQ <BR>ums.domain:
queue <BR>ums.mom: openmq <BR>ums.status: 200 <BR>Content-Type:
text/plain;charset=UTF-8 <BR>Content-Length: 11 <BR>Date: Tue, 02 Sep
2008 23:04:05 GMT <BR><BR>SimpleMsg_0<BR><BR>The following is a
<B>receive_reply</B> response message for a <B>receive</B> service
request that timed out with no message available.</P>
<P>HTTP/1.1 200 OK <BR>Server: Apache-Coyote/1.1 <BR>ums.service:
receive_reply <BR>ums.destination: simpleMessagingQ <BR>ums.domain:
queue <BR>ums.mom: openmq <BR>ums.status: 404 <BR>Content-Type:
text/plain;charset=UTF-8 <BR>Content-Length: 0 <BR>Date: Wed, 03 Sep
2008 17:21:38 GMT <BR><BR><B><FONT SIZE=3 STYLE="font-size: 13pt">2.
XML Messaging API Example:</FONT></B></P>
<P>The following is a <B>receive_reply</B> response message that
includes a retrieved SOAP message with Service element attribute
values in the header. 
</P>
<P>HTTP/1.1 200 OK <BR>Server: Apache-Coyote/1.1 <BR>host:
localhost:8888 <BR>pragma: no-cache <BR>user-agent: Java/1.6.0_07
<BR>cache-control: no-cache <BR>accept: */*; q=.2 <BR>soapaction: &quot;&quot;
<BR>connection: keep-alive <BR>Content-Type: multipart/related;
type=&quot;text/xml&quot;;
boundary=&quot;----=_Part_1_2012387303.1220396786081&quot;
<BR>Transfer-Encoding: chunked <BR>Date: Tue, 02 Sep 2008 23:06:25
GMT <BR><BR>27d <BR>------=_Part_1_2012387303.1220396786081
<BR>Content-Type: text/xml; charset=utf-8 <BR><BR>&lt;SOAP-ENV:Envelope
xmlns:SOAP-ENV=&quot;<A HREF="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</A>&quot;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SOAP-ENV:Header&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ums:MessageHeader
xmlns:ums=&quot;https://mq.java.net/ums&quot; ums:id=&quot;1.0&quot;
ums:version=&quot;1.0&quot;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ums:Service
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:service=&quot;receive_reply&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:destination=&quot;XMLmessagingQ&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:domain=&quot;queue&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:mom=&quot;openmq&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:status=&quot;200&quot;/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ums:MessageHeader&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/SOAP-ENV:Header&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SOAP-ENV:Body&gt;&lt;bodyvalue&gt;1220396785822&lt;/bodyvalue&gt;&lt;/SOAP-ENV:Body&gt;<BR>&lt;/SOAP-ENV:Envelope&gt;
<BR>------=_Part_1_2012387303.1220396786081 <BR>Content-Type:
text/plain <BR><BR>attached msg-Tue Sep 02 16:06:26 PDT
2008-1220396786067 <BR>------=_Part_1_2012387303.1220396786081--
<BR><BR>The following is a <B>receive_reply</B> response message for
a <B>receive</B> service request that timed out with no message
available to retrieve.</P>
<P>HTTP/1.1 200 OK <BR>Server: Apache-Coyote/1.1 <BR>Accept:
text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
<BR>Content-Type: text/xml;charset=utf-8 <BR>Transfer-Encoding:
chunked <BR>Date: Wed, 03 Sep 2008 17:18:53 GMT <BR><BR>&lt;SOAP-ENV:Envelope
xmlns:SOAP-ENV=&quot;<A HREF="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</A>&quot;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SOAP-ENV:Header&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ums:MessageHeader
xmlns:ums=&quot;https://mq.java.net/ums&quot; ums:id=&quot;1.0&quot;
ums:version=&quot;1.0&quot;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ums:Service
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:destination=&quot;XMLmessagingQ&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:domain=&quot;queue&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:service=&quot;receive_reply&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:mom=&quot;openmq&quot;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ums:status=&quot;404&quot;/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ums:MessageHeader&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/SOAP-ENV:Header&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SOAP-ENV:Body/&gt;<BR>&lt;/SOAP-ENV:Envelope&gt;
<BR><BR><A HREF="./protocol.html">Back to UMS protocol page.</A></P>
</BODY>
</HTML>
